/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DailyDistPanel.java
 *
 * Created on Oct 11, 2009, 2:31:45 PM
 */

package trafficgeneratorcr.gui;

import java.awt.BorderLayout;
import trafficgeneratorcr.algo.InterpolationAlgorithm;
import trafficgeneratorcr.algo.LinearInterpolationAlgorithm;
import trafficgeneratorcr.algo.NormalisationAlgorithm;

/**
 *
 * @author ccrisan
 */
public class WeeksDistPanel extends javax.swing.JPanel {

    private static final int INTERP_SIZE = 1000;

    private PlotterPanel plotterPanel;
    private int numberOfWeeks;

    /** Creates new form WeeksDistPanel */
    public WeeksDistPanel() {
        initComponents();

        plotterPanel = new PlotterPanel();
        plotParentPanel.add(plotterPanel, BorderLayout.CENTER);

        repaintPlot();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton2 = new javax.swing.JButton();
        plotParentPanel = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jSlider1 = new javax.swing.JSlider();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jSlider2 = new javax.swing.JSlider();
        jPanel5 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jSlider3 = new javax.swing.JSlider();
        jPanel6 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jSlider4 = new javax.swing.JSlider();
        jPanel7 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jSlider5 = new javax.swing.JSlider();
        jPanel8 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jSlider6 = new javax.swing.JSlider();
        jPanel9 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jSlider7 = new javax.swing.JSlider();
        jPanel10 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jSlider8 = new javax.swing.JSlider();
        jPanel11 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jSlider9 = new javax.swing.JSlider();
        jPanel12 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jSlider10 = new javax.swing.JSlider();
        jPanel13 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jSlider11 = new javax.swing.JSlider();
        jPanel14 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jSlider12 = new javax.swing.JSlider();
        jPanel15 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jSlider13 = new javax.swing.JSlider();
        jPanel16 = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        jSlider14 = new javax.swing.JSlider();
        jPanel17 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jSlider15 = new javax.swing.JSlider();
        jPanel18 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jSlider16 = new javax.swing.JSlider();
        jPanel19 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jSlider17 = new javax.swing.JSlider();
        jPanel20 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jSlider18 = new javax.swing.JSlider();
        jPanel21 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        jSlider19 = new javax.swing.JSlider();
        jPanel22 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jSlider20 = new javax.swing.JSlider();
        jPanel23 = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jSlider21 = new javax.swing.JSlider();
        jPanel24 = new javax.swing.JPanel();
        jLabel22 = new javax.swing.JLabel();
        jSlider22 = new javax.swing.JSlider();
        jPanel25 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jSlider23 = new javax.swing.JSlider();
        jPanel26 = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        jSlider24 = new javax.swing.JSlider();
        jPanel27 = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        jSlider25 = new javax.swing.JSlider();

        jButton2.setText("jButton2");

        setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Weeks Distribution"));
        setLayout(new java.awt.GridLayout(2, 1));

        plotParentPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        plotParentPanel.setLayout(new java.awt.BorderLayout());
        add(plotParentPanel);

        jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPanel2.setLayout(new java.awt.GridLayout(1, 25));

        jPanel3.setLayout(new java.awt.BorderLayout());

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("00");
        jPanel3.add(jLabel1, java.awt.BorderLayout.PAGE_START);

        jSlider1.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel3.add(jSlider1, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel3);

        jPanel4.setLayout(new java.awt.BorderLayout());

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("01");
        jPanel4.add(jLabel2, java.awt.BorderLayout.PAGE_START);

        jSlider2.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider2.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel4.add(jSlider2, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel4);

        jPanel5.setLayout(new java.awt.BorderLayout());

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("02");
        jPanel5.add(jLabel3, java.awt.BorderLayout.PAGE_START);

        jSlider3.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider3.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel5.add(jSlider3, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel5);

        jPanel6.setLayout(new java.awt.BorderLayout());

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("03");
        jPanel6.add(jLabel4, java.awt.BorderLayout.PAGE_START);

        jSlider4.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider4.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel6.add(jSlider4, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel6);

        jPanel7.setLayout(new java.awt.BorderLayout());

        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText("04");
        jPanel7.add(jLabel5, java.awt.BorderLayout.PAGE_START);

        jSlider5.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider5.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel7.add(jSlider5, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel7);

        jPanel8.setLayout(new java.awt.BorderLayout());

        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText("05");
        jPanel8.add(jLabel6, java.awt.BorderLayout.PAGE_START);

        jSlider6.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider6.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel8.add(jSlider6, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel8);

        jPanel9.setLayout(new java.awt.BorderLayout());

        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel7.setText("06");
        jPanel9.add(jLabel7, java.awt.BorderLayout.PAGE_START);

        jSlider7.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider7.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel9.add(jSlider7, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel9);

        jPanel10.setLayout(new java.awt.BorderLayout());

        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("07");
        jPanel10.add(jLabel8, java.awt.BorderLayout.PAGE_START);

        jSlider8.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider8.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel10.add(jSlider8, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel10);

        jPanel11.setLayout(new java.awt.BorderLayout());

        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel9.setText("08");
        jPanel11.add(jLabel9, java.awt.BorderLayout.PAGE_START);

        jSlider9.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider9.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel11.add(jSlider9, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel11);

        jPanel12.setLayout(new java.awt.BorderLayout());

        jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel10.setText("09");
        jPanel12.add(jLabel10, java.awt.BorderLayout.PAGE_START);

        jSlider10.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider10.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel12.add(jSlider10, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel12);

        jPanel13.setLayout(new java.awt.BorderLayout());

        jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel11.setText("10");
        jPanel13.add(jLabel11, java.awt.BorderLayout.PAGE_START);

        jSlider11.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider11.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel13.add(jSlider11, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel13);

        jPanel14.setLayout(new java.awt.BorderLayout());

        jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel12.setText("11");
        jPanel14.add(jLabel12, java.awt.BorderLayout.PAGE_START);

        jSlider12.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider12.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel14.add(jSlider12, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel14);

        jPanel15.setLayout(new java.awt.BorderLayout());

        jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel13.setText("12");
        jPanel15.add(jLabel13, java.awt.BorderLayout.PAGE_START);

        jSlider13.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider13.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel15.add(jSlider13, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel15);

        jPanel16.setLayout(new java.awt.BorderLayout());

        jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel14.setText("13");
        jPanel16.add(jLabel14, java.awt.BorderLayout.PAGE_START);

        jSlider14.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider14.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel16.add(jSlider14, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel16);

        jPanel17.setLayout(new java.awt.BorderLayout());

        jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel15.setText("14");
        jPanel17.add(jLabel15, java.awt.BorderLayout.PAGE_START);

        jSlider15.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider15.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel17.add(jSlider15, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel17);

        jPanel18.setLayout(new java.awt.BorderLayout());

        jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel16.setText("15");
        jPanel18.add(jLabel16, java.awt.BorderLayout.PAGE_START);

        jSlider16.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider16.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel18.add(jSlider16, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel18);

        jPanel19.setLayout(new java.awt.BorderLayout());

        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel17.setText("16");
        jPanel19.add(jLabel17, java.awt.BorderLayout.PAGE_START);

        jSlider17.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider17.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel19.add(jSlider17, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel19);

        jPanel20.setLayout(new java.awt.BorderLayout());

        jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel18.setText("17");
        jPanel20.add(jLabel18, java.awt.BorderLayout.PAGE_START);

        jSlider18.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider18.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel20.add(jSlider18, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel20);

        jPanel21.setLayout(new java.awt.BorderLayout());

        jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel19.setText("18");
        jPanel21.add(jLabel19, java.awt.BorderLayout.PAGE_START);

        jSlider19.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider19.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel21.add(jSlider19, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel21);

        jPanel22.setLayout(new java.awt.BorderLayout());

        jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel20.setText("19");
        jPanel22.add(jLabel20, java.awt.BorderLayout.PAGE_START);

        jSlider20.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider20.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel22.add(jSlider20, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel22);

        jPanel23.setLayout(new java.awt.BorderLayout());

        jLabel21.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel21.setText("20");
        jPanel23.add(jLabel21, java.awt.BorderLayout.PAGE_START);

        jSlider21.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider21.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel23.add(jSlider21, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel23);

        jPanel24.setLayout(new java.awt.BorderLayout());

        jLabel22.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel22.setText("21");
        jPanel24.add(jLabel22, java.awt.BorderLayout.PAGE_START);

        jSlider22.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider22.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel24.add(jSlider22, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel24);

        jPanel25.setLayout(new java.awt.BorderLayout());

        jLabel23.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel23.setText("22");
        jPanel25.add(jLabel23, java.awt.BorderLayout.PAGE_START);

        jSlider23.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider23.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel25.add(jSlider23, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel25);

        jPanel26.setLayout(new java.awt.BorderLayout());

        jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel24.setText("23");
        jPanel26.add(jLabel24, java.awt.BorderLayout.PAGE_START);

        jSlider24.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider24.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel26.add(jSlider24, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel26);

        jPanel27.setLayout(new java.awt.BorderLayout());

        jLabel25.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel25.setText("24");
        jPanel27.add(jLabel25, java.awt.BorderLayout.PAGE_START);

        jSlider25.setOrientation(javax.swing.JSlider.VERTICAL);
        jSlider25.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderStateChanged(evt);
            }
        });
        jPanel27.add(jSlider25, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel27);

        add(jPanel2);
    }// </editor-fold>//GEN-END:initComponents

    private void jSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderStateChanged
        repaintPlot();
    }//GEN-LAST:event_jSliderStateChanged


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel25;
    private javax.swing.JPanel jPanel26;
    private javax.swing.JPanel jPanel27;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JSlider jSlider1;
    private javax.swing.JSlider jSlider10;
    private javax.swing.JSlider jSlider11;
    private javax.swing.JSlider jSlider12;
    private javax.swing.JSlider jSlider13;
    private javax.swing.JSlider jSlider14;
    private javax.swing.JSlider jSlider15;
    private javax.swing.JSlider jSlider16;
    private javax.swing.JSlider jSlider17;
    private javax.swing.JSlider jSlider18;
    private javax.swing.JSlider jSlider19;
    private javax.swing.JSlider jSlider2;
    private javax.swing.JSlider jSlider20;
    private javax.swing.JSlider jSlider21;
    private javax.swing.JSlider jSlider22;
    private javax.swing.JSlider jSlider23;
    private javax.swing.JSlider jSlider24;
    private javax.swing.JSlider jSlider25;
    private javax.swing.JSlider jSlider3;
    private javax.swing.JSlider jSlider4;
    private javax.swing.JSlider jSlider5;
    private javax.swing.JSlider jSlider6;
    private javax.swing.JSlider jSlider7;
    private javax.swing.JSlider jSlider8;
    private javax.swing.JSlider jSlider9;
    private javax.swing.JPanel plotParentPanel;
    // End of variables declaration//GEN-END:variables

    public double[] getWeeksDistribution() {
        double[] distributionPoints = new double[25];
        double[] selectedDistributionPoints = new double[numberOfWeeks];

        // obtain values from GUI sliders
        distributionPoints[0] = jSlider1.getValue();
        distributionPoints[1] = jSlider2.getValue();
        distributionPoints[2] = jSlider3.getValue();
        distributionPoints[3] = jSlider4.getValue();
        distributionPoints[4] = jSlider5.getValue();
        distributionPoints[5] = jSlider6.getValue();
        distributionPoints[6] = jSlider7.getValue();
        distributionPoints[7] = jSlider8.getValue();
        distributionPoints[8] = jSlider9.getValue();
        distributionPoints[9] = jSlider10.getValue();
        distributionPoints[10] = jSlider11.getValue();
        distributionPoints[11] = jSlider12.getValue();
        distributionPoints[12] = jSlider13.getValue();
        distributionPoints[13] = jSlider14.getValue();
        distributionPoints[14] = jSlider15.getValue();
        distributionPoints[15] = jSlider16.getValue();
        distributionPoints[16] = jSlider17.getValue();
        distributionPoints[17] = jSlider18.getValue();
        distributionPoints[18] = jSlider19.getValue();
        distributionPoints[19] = jSlider20.getValue();
        distributionPoints[20] = jSlider21.getValue();
        distributionPoints[21] = jSlider22.getValue();
        distributionPoints[22] = jSlider23.getValue();
        distributionPoints[23] = jSlider24.getValue();
        distributionPoints[24] = jSlider25.getValue();

        InterpolationAlgorithm interpolationAlgorithm = new LinearInterpolationAlgorithm(distributionPoints, INTERP_SIZE);
        interpolationAlgorithm.execute();
        double[] interpolatedValues = interpolationAlgorithm.getInterpolatedPoints();

        for(int n = 0; n < numberOfWeeks; n++) {
            int x = n * interpolatedValues.length / numberOfWeeks;
            selectedDistributionPoints[n] = interpolatedValues[x];
        }

        NormalisationAlgorithm normalisationAlgorithm = new NormalisationAlgorithm(interpolatedValues);
        normalisationAlgorithm.execute();
        return normalisationAlgorithm.getOutputPoints();
    }

    public void setNumberOfWeeks(int numberOfWeeks) {
        this.numberOfWeeks = numberOfWeeks;
        updateLabels();
    }

    private void repaintPlot() {
        double[] distributionPoints = new double[25];

        // obtain values from GUI sliders
        distributionPoints[0] = jSlider1.getValue();
        distributionPoints[1] = jSlider2.getValue();
        distributionPoints[2] = jSlider3.getValue();
        distributionPoints[3] = jSlider4.getValue();
        distributionPoints[4] = jSlider5.getValue();
        distributionPoints[5] = jSlider6.getValue();
        distributionPoints[6] = jSlider7.getValue();
        distributionPoints[7] = jSlider8.getValue();
        distributionPoints[8] = jSlider9.getValue();
        distributionPoints[9] = jSlider10.getValue();
        distributionPoints[10] = jSlider11.getValue();
        distributionPoints[11] = jSlider12.getValue();
        distributionPoints[12] = jSlider13.getValue();
        distributionPoints[13] = jSlider14.getValue();
        distributionPoints[14] = jSlider15.getValue();
        distributionPoints[15] = jSlider16.getValue();
        distributionPoints[16] = jSlider17.getValue();
        distributionPoints[17] = jSlider18.getValue();
        distributionPoints[18] = jSlider19.getValue();
        distributionPoints[19] = jSlider20.getValue();
        distributionPoints[20] = jSlider21.getValue();
        distributionPoints[21] = jSlider22.getValue();
        distributionPoints[22] = jSlider23.getValue();
        distributionPoints[23] = jSlider24.getValue();
        distributionPoints[24] = jSlider25.getValue();

        /*InterpolationAlgorithm interpolationAlgorithm = new LinearInterpolationAlgorithm(distributionPoints, 59);
        interpolationAlgorithm.execute();
        double[] interpolatedValues = interpolationAlgorithm.getInterpolatedPoints();

        NormalisationAlgorithm normalisationAlgorithm = new NormalisationAlgorithm(interpolatedValues);
        normalisationAlgorithm.execute();
        yValues = normalisationAlgorithm.getOutputPoints();*/

        plotterPanel.setPlotData(distributionPoints);
    }

    private void updateLabels() {
        String s = String.valueOf(10);
        jLabel1.setText(String.valueOf(0 * numberOfWeeks / 25));
        jLabel2.setText(String.valueOf(1 * numberOfWeeks / 25));
        jLabel3.setText(String.valueOf(2 * numberOfWeeks / 25));
        jLabel4.setText(String.valueOf(3 * numberOfWeeks / 25));
        jLabel5.setText(String.valueOf(4 * numberOfWeeks / 25));
        jLabel6.setText(String.valueOf(5 * numberOfWeeks / 25));
        jLabel7.setText(String.valueOf(6 * numberOfWeeks / 25));
        jLabel8.setText(String.valueOf(7 * numberOfWeeks / 25));
        jLabel9.setText(String.valueOf(8 * numberOfWeeks / 25));
        jLabel10.setText(String.valueOf(9 * numberOfWeeks / 25));
        jLabel11.setText(String.valueOf(10 * numberOfWeeks / 25));
        jLabel12.setText(String.valueOf(11 * numberOfWeeks / 25));
        jLabel13.setText(String.valueOf(12 * numberOfWeeks / 25));
        jLabel14.setText(String.valueOf(13 * numberOfWeeks / 25));
        jLabel15.setText(String.valueOf(14 * numberOfWeeks / 25));
        jLabel16.setText(String.valueOf(15 * numberOfWeeks / 25));
        jLabel17.setText(String.valueOf(16 * numberOfWeeks / 25));
        jLabel18.setText(String.valueOf(17 * numberOfWeeks / 25));
        jLabel19.setText(String.valueOf(18 * numberOfWeeks / 25));
        jLabel20.setText(String.valueOf(19 * numberOfWeeks / 25));
        jLabel21.setText(String.valueOf(20 * numberOfWeeks / 25));
        jLabel22.setText(String.valueOf(21 * numberOfWeeks / 25));
        jLabel23.setText(String.valueOf(22 * numberOfWeeks / 25));
        jLabel24.setText(String.valueOf(23 * numberOfWeeks / 25));
        jLabel25.setText(String.valueOf(24 * numberOfWeeks / 25));
    }

}
